/**
 * 分类导航数据
 */
import { findHeadCategory } from '@/api/home'

export default {
  namespaced: true,
  state: {
    navs: []
  },

  mutations: {
    // 存储 navs(同步)
    setNavs (state, navs) {
      state.navs = navs
    }
  },
  actions: {
    //   调用后台获取 navs的接口
    async getNavsActions ({ commit }, payload) {
      const { result } = await findHeadCategory()
      commit('setNavs', result)
    }
  }
}
